﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkedTime.Cnsl.ProgramEntities;
using WorkedTime.Cnsl.ProgramEntities.ProgramActions;
using WorkedTime.Cnsl.ProgramEntities.ProgramEnums;

namespace WorkedTime.Cnsl
{
    class Program
    {
        static string userOption;
        static ProgramOptions programOption;
        static IProgramAction programAction;

        static void Main(string[] args)
        {
            do
            {
                userOption = ProgramUserInteraction.AskUserOption();
                if (Enum.TryParse<ProgramOptions>(userOption, out programOption))
                {
                    programAction = ProgramActionFactory.GetAction(programOption);
                    programAction.Execute();
                }
            } while (ProgramState.HasToRun);
        }
    }
}
